<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<LINK href="<?=$this->styleurl?>/images/index.css" type=text/css rel=stylesheet />
</head>
<body>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 
            CALLPADDING="0">
              <TBODY>
			                <TR BORDER="0" WIDTH="100%">
                <TD style="PADDING-LEFT: 8px; PADDING-TOP: 8px" vAlign=top 
                align=left bgColor=#ffffff height=30 colspan="7">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="34%" height="20"><img src="<?=$this->styleurl?>/images/url_01.gif" width="7" height="10" />&nbsp;<strong>文章列表</strong></td>
                    <td height="20"><div align="right"><a href="<?=$this->adminurl?>/article/addarticle">添加文章</a>&nbsp;&nbsp;</div></td>
                  </tr>
                </table>				 </TD>
              </TR>
			  <form id="form2" name="form2" method="post" action="<?=$this->adminurl?>/article/submitart">
			  
			  <tr>
                    <td height="20" bgcolor="#999999" style="PADDING-LEFT: 8px; PADDING-TOP: 8px"><input type="checkbox" name="selall" title="全选"  onClick="select_all('form2','ChkKindId[]',this.name)">&nbsp;</td>
                    <td width="40%" bgcolor="#999999" style="PADDING-LEFT: 8px; PADDING-TOP: 8px"><div class="STYLE1" style="text-align:center">内容</div></td>
                	<td width="17%" bgcolor="#999999" class="STYLE1"><div align="center">留言者</div></td>
                    <td width="15%" bgcolor="#999999" class="STYLE1"><div align="center">留言时间</div></td>
                    <td bgcolor="#999999"><div align="center" class="STYLE1">留言ip</div></td>
                    <td bgcolor="#999999"><div align="center">操作</div></td>
			  </tr>
			  <?php 
			  foreach ($this->paginator as $row):
			  ?>
              <TR BORDER="0" WIDTH="100%" bgcolor="#EEEEEE" onmousemove="this.style.color='#000000';this.style.backgroundColor='#D5D5D5'" onmouseout="this.style.backgroundColor='#EEEEEE';this.style.color='#000000'">
                <TD height=25 align=left vAlign=top style="PADDING-LEFT: 8px; PADDING-TOP: 8px; border-bottom:#666666 dotted 1px;"><input name="ChkKindId[]" type="checkbox" id="ChkKindId[]" value="<?=$row["mes_id"]?>"  /></TD>
                <TD  height=25 align=left vAlign=top style="PADDING-LEFT: 8px; PADDING-TOP: 8px; border-bottom:#666666 dotted 1px;">
                <?php if(strlen($row["mes_content"])>60) echo mb_substr($row["mes_content"],0,20,"utf-8")."…"; else echo $row["mes_content"];?></TD>
                <TD align=left vAlign=top style="PADDING-LEFT: 8px; PADDING-TOP: 8px;border-bottom:#666666 dotted 1px;">
                  
                  <div align="center"><?=$row["mes_writer"]?></div></TD>
                <TD align=left vAlign=top style="PADDING-LEFT: 8px; PADDING-TOP: 8px;border-bottom:#666666 dotted 1px;"><div align="center">
                  <?=date("Y-m-d",$row["mes_date"]);?>
                </div></TD>
                <TD align=left vAlign=top style="PADDING-LEFT: 8px; PADDING-TOP: 8px;border-bottom:#666666 dotted 1px;"><div align="center"><?=$row["mes_ip"]?></div></TD>

                <TD align=left vAlign=top style="PADDING-LEFT: 8px; PADDING-TOP: 8px;border-bottom:#666666 dotted 1px;"><div align="center"><a href="<?=$this->adminurl?>/message/reply?id=<?=$row["mes_id"]?>">回复</a> </div></TD>
              </TR>
              <?php
              endforeach;
              ?>
			<TR BORDER="0" WIDTH="100%">
              <TD height="30"  colspan="7">&nbsp;&nbsp;
                <input type="image" src="<?=$this->styleurl?>/images/del.gif" align="absmiddle" border="0" name="del" onclick="javascript:return chkform(form2.name,'确定刪除吗？','del');" />
&nbsp;&nbsp;
<input name="action" type="hidden" id="action" /></TD>
			</TR>
		  </form>
<TR BORDER="0" WIDTH="100%">
			  <TD height="30"  colspan="7">
			  <div class="page"> <?=$this->paginationControl($this->paginator, 'Elastic', 'pagestyle.phtml'); ?></div></TD>
			  </TR>
      </TABLE>
     
</body>
</html>
<script language="JavaScript" >

function chkform(theForm,msg,action){
	if (confirm(msg)){

		document.forms[theForm].action.value = action;
		document.forms[theForm].submit();
		return true;
	}else{
		return false;
	}
}

// -------- 全選或取消 checkbox 方塊
<!--
function select_all(formName, elementName, selectAllName) {
	if(document.forms[formName].elements[selectAllName].checked) {
		
		if(document.forms[formName].elements[selectAllName].length = 1 &&
		    typeof(document.forms[formName].elements[elementName]) != "undefined" ) {
		
			document.forms[formName].elements[elementName].checked = true;

		    for(var i = 0; i < document.forms[formName].elements[elementName].length; i++)
			document.forms[formName].elements[elementName][i].checked = true;
		}
	}
	else {
		if(document.forms[formName].elements[selectAllName].length = 1 &&
		    typeof(document.forms[formName].elements[elementName]) != "undefined" ) {
			document.forms[formName].elements[elementName].checked = false;

		    for(var i = 0; i < document.forms[formName].elements[elementName].length; i++)
				document.forms[formName].elements[elementName][i].checked = false;
		}
	}
}
//-->

</script>